%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
images=np.load("predict_image_epoch150.npy")
start=0
goal=start+100
hoge= np.sqrt(len(images[0,0,start:goal]))
plt.figure(figsize=(15, 15), dpi=800)
for i in xrange(len(images[0,0,start:goal])):
plt.subplot(hoge+1,hoge+1 , i+1)
fig = plt.imshow(images[:,:,start+i])
plt.axis('off')
plt.figure()
plt.imshow(world,"gray")
plt.scatter(trajectory[0,0:100]-14,trajectory[1,0:100]-14,color='g')
plt.axis('off')
plt.show()
start=4000
goal=start+100
hoge= np.sqrt(len(images[0,0,start:goal]))
plt.figure(figsize=(15, 15), dpi=800)
for i in xrange(len(images[0,0,start:goal])):
plt.subplot(hoge+1,hoge+1 , i+1)
fig = plt.imshow(images[:,:,start+i])
plt.axis('off')
plt.figure()
plt.imshow(world,"gray")
plt.scatter(trajectory[0,4000:4100]-14,trajectory[1,4000:4100]-14,color='g')
plt.axis('off')
plt.show()
start=8000
goal=start+100
hoge= np.sqrt(len(images[0,0,start:goal]))
plt.figure(figsize=(15, 15), dpi=800)
for i in xrange(len(images[0,0,start:goal])):
plt.subplot(hoge+1,hoge+1 , i+1)
fig = plt.imshow(images[:,:,start+i])
plt.axis('off')
plt.figure()
plt.imshow(world,"gray")
plt.scatter(trajectory[0,8000:8100]-14,trajectory[1,8000:8100]-14,color='g')
plt.axis('off')
plt.show()
start=12000
goal=start+100
hoge= np.sqrt(len(images[0,0,start:goal]))
plt.figure(figsize=(15, 15), dpi=800)
for i in xrange(len(images[0,0,start:goal])):
plt.subplot(hoge+1,hoge+1 , i+1)
fig = plt.imshow(images[:,:,start+i])
plt.axis('off')
plt.figure()
plt.imshow(world,"gray")
plt.scatter(trajectory[0,12000:12100]-14,trajectory[1,12000:12100]-14,color='g')
plt.axis('off')
plt.show()
trajectory=np.load("trajectory_epoch150.npy")
i=1000
plt.plot(trajectory[0,:i],trajectory[1,:i])
plt.xlim([0, 28*3])
plt.ylim([0,28*3])
world=np.load("world1.npy")
plt.imshow(world)
plt.figure()
plt.imshow(world,"gray")
plt.scatter(trajectory[0,:i]-14,trajectory[1,:i]-14,color='g')
plt.axis('off')
plt.show()
=4000
plt.scatter(trajectory[0,-i:],trajectory[1,-i:], )
#plt.xlim([0, 28*3])
#plt.ylim([0,28*3])
recoloss=np.load("recon_loss_epoch150.npy")
plt.plot(recoloss)
recoloss.shape
fig = plt.figure()
plt.axis('off')
ims = []
for i in range(100):
im = plt.scatter(trajectory[0,:i]-14,trajectory[1,:i]-14,color='g')
ims.append(im)
ani = animation.ArtistAnimation(fig, ims, interval=10)
ani.save("output.gif", writer="imagemagick")